package com.mapforge.gui.interfaces;

import java.awt.event.KeyListener;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;

import com.mapforge.listener.TileMapCreationListener;
import com.mapforge.listener.TileSelectionEvent;
import com.mapforge.listener.TileSelectionListener;
import com.mapforge.listener.TilesetEditListener;

/**
 * All components wishing to represent a GUI component in which tile selections
 * can occur implement {@link TileSelectionGUIInterface} and will inform
 * registered {@link TileSelectionListener} of {@link TileSelectionEvent} which
 * occur upon itself.  
 * 
 * @author Will Morrison
 * @see TileSelectionListener
 * @see TileSelectionEvent
 */
public interface TileSelectionGUIInterface extends MouseListener,
		MouseMotionListener, TileSelectionListener, TileMapCreationListener,
		TilesetEditListener, KeyListener {
	/**
	 * Registers the specified {@link TileSelectionListener} as a listener for
	 * any {@link TileSelectionEvent} this entity would produce.
	 * 
	 * @param listener
	 *            {@link TileSelectionListener} to register with this entity
	 */
	public void addTileSelectionListener(TileSelectionListener listener);

	/**
	 * Attempts to unregister the specified {@link TileSelectionListener} as a
	 * listener to this entity, and returns the result of the operation. If the
	 * result returned is true, the specified {@link TileSelectionListener} will
	 * no longer receive {@link TileSelectionEvent} from this entity.
	 * 
	 * @param listener
	 *            specified {@link TileSelectionListener} to unregister
	 * @return whether specified listener was present and successfully
	 *         unregistered
	 */
	public boolean removeTileSelectionListener(TileSelectionListener listener);

	/**
	 * Removes all registered listeners of type {@link TileSelectionListener}.
	 * This entity will inform no other entities of events of type
	 * {@link TileSelectionEvent} after this function is called.
	 */
	public void clearTileSelectionListeners();
}
